-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frontend: Add feature to view deploy logs #2581
base: main
Are you sure you want to change the base?
Conversation
d9de25c
to
d542f04
Compare
So weird, I ran the tests locally, updated snapshots, wonder why it is still failing 🤔 |
Changing some UX for this |
d542f04
to
b2cf8f3
Compare
Updated, please review |
46a12fb
to
7daec5f
Compare
7848c4f
to
016f070
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 41 out of 57 changed files in this pull request and generated no comments.
Files not reviewed (16)
- frontend/src/components/common/Resource/MainInfoSection/snapshots/MainInfoSection.Normal.stories.storyshot: Language not supported
- frontend/src/components/common/Resource/MainInfoSection/snapshots/MainInfoSection.NullBacklink.stories.storyshot: Language not supported
- frontend/src/components/configmap/snapshots/Details.Empty.stories.storyshot: Language not supported
- frontend/src/components/configmap/snapshots/Details.WithBase.stories.storyshot: Language not supported
- frontend/src/components/crd/snapshots/CustomResourceDefinition.Details.stories.storyshot: Language not supported
- frontend/src/components/crd/snapshots/CustomResourceDetails.NoError.stories.storyshot: Language not supported
- frontend/src/components/cronjob/snapshots/CronJobDetails.EveryAst.stories.storyshot: Language not supported
- frontend/src/components/cronjob/snapshots/CronJobDetails.EveryMinute.stories.storyshot: Language not supported
- frontend/src/components/endpoints/snapshots/EndpointDetails.Default.stories.storyshot: Language not supported
- frontend/src/components/endpoints/snapshots/EndpointDetails.Error.stories.storyshot: Language not supported
- frontend/src/components/horizontalPodAutoscaler/snapshots/HPADetails.Default.stories.storyshot: Language not supported
- frontend/src/components/horizontalPodAutoscaler/snapshots/HPADetails.Error.stories.storyshot: Language not supported
- frontend/src/components/ingress/snapshots/ClassDetails.Basic.stories.storyshot: Language not supported
- frontend/src/components/ingress/snapshots/ClassDetails.WithDefault.stories.storyshot: Language not supported
- frontend/src/components/ingress/snapshots/Details.WithResource.stories.storyshot: Language not supported
- frontend/src/components/ingress/snapshots/Details.WithTLS.stories.storyshot: Language not supported
This adds feature to view all the pods of pods in a deployment rather than going to a specific pod. Fixes: #2552 Signed-off-by: Kautilya Tripathi <[email protected]>
016f070
to
bbf2d1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be a very useful feature for people. It's very often the case I've personally wanted to look at all the logs in a deployment rather than ones from just one pod.
I think the error states could be added for if any request fails. Left a couple of notes in the spots I think they could be handled.
Maybe not in this PR... but it would probably good to add a loading state? I'm not sure if the logs already have a loading state? (I didn't look).
Adding some states into a LogsButton.stories.tsx would be nice to have.
// Handler for initial logs button click | ||
async function handleClick() { | ||
if (item instanceof Deployment) { | ||
const fetchedPods = await getRelatedPods(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be error handling for this. With a try/catch, and telling the user that something went wrong if something does.
async function getRelatedPods(): Promise<Pod[]> { | ||
if (item instanceof Deployment) { | ||
const labelSelector = item.getMatchLabelsList().join(','); | ||
const response = await request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be error handling for this. With a try/catch, and telling the user that something went wrong if something does.
{/* Follow logs switch */} | ||
<FormControlLabel | ||
control={<Switch checked={follow} onChange={handleFollowChange} size="small" />} | ||
label="Follow" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Label should be translated.
{/* Timestamps switch */} | ||
<FormControlLabel | ||
control={<Switch checked={showTimestamps} onChange={handleTimestampsChange} size="small" />} | ||
label="Timestamps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Label should be translated.
This adds feature to view all the pods of pods in a deployment rather than going to a specific pod.
Fixes: #2552
Testing
kubectl create deployment nginx --image=nginx --replicas=3
Screenshots